import java.util.ArrayList;
import java.util.Scanner;

public class PTA_6_82 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(i,scanner.nextInt());
        }
        int max = list.get(0);
        int min = list.get(0);
        for (int i = 0; i < list.size(); i++) {
            int tmp = list.get(i);
            if(max < tmp) {
                max = tmp;
            }
            if(min > tmp) {
                min = tmp;
            }
        }
        System.out.println(list.toString());
        System.out.println("数列中最大的数是:"+max) ;
        System.out.println("数列中最小的数是:"+min) ;
    }
}
